import React from 'react'
import { Route, Routes } from 'react-router-dom'
import { PageRouterConfig } from './routerConfig'
import { Redirect, getStorageItem } from '@/utils'
import NotFound from '../pages/404/index'

const PageRouters = () => {
  return (
    <Routes>
      <Route path={'/'} element={<Redirect to={'/sys/'} />} />
      {PageRouterConfig.map((route) => {
return <Route path={`${route.path}/*`} element={<route.element />} key={route.name} />
      })}
      <Route path={'*'} element={<NotFound />} />
    </Routes>
  )
}

export default PageRouters
